<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<c:set value="${c.module.moduleName}" var="moduleName" scope="request" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>查看${c.title}</title>
	</head>
	<body>
		<table class="table-layout">
			<#assign trCount = 0>
			<#list c.properties as p>
			<#assign trCount = trCount + 1>
			<tr class="<#if trCount%2 == 1>tr-odd<#else>tr-even</#if>">
				<td class="td-label">
					${p.element.title}
				</td>
				<td>
					<c:out value="${"$"}{entity.${p.name}}" />
				</td>
			</tr>
			</#list>
		    <#list c.oneToOne as o>
		    <#if o.inverse == "false">
		    <#assign trCount = trCount + 1>
			<tr class="<#if trCount%2 == 1>tr-odd<#else>tr-even</#if>">
				<td class="td-label">
					<label>
						${c.findClass(o.className,config).title}
					</label>
				</td>
				<td>
					<#assign pcount = 1>
					<#list c.findClass(o.className,config).properties as p>
					<#if p.show == "true" && pcount == 1>
					<#assign pcount = pcount + 1>
					<c:out value="${"$"}{entity.${o.name}.${p.name}}" />&nbsp;
					</#if>
					</#list>
				</td>
			</tr>
		    </#if>
		    </#list>
		    <#list c.manyToOne as o>
		    <#assign trCount = trCount + 1>
			<tr class="<#if trCount%2 == 1>tr-odd<#else>tr-even</#if>">
				<td class="td-label">
					<label>
						${c.findClass(o.className,config).title}
					</label>
				</td>
				<td>
					<#list c.findClass(o.className,config).properties as p>
					<#if p.show == "true">
					<c:out value="${"$"}{entity.${o.name}.${p.name}}" />&nbsp;
					</#if>
					</#list>
				</td>
			</tr>
		    </#list>
		    <#list c.oneToMany as o>
		    <#assign trCount = trCount + 1>
			<tr class="<#if trCount%2 == 1>tr-odd<#else>tr-even</#if>">
				<td class="td-label">
					<label>
						${c.findClass(o.className,config).title}
					</label>
				</td>
				<td>
					<c:forEach items="${"$"}{entity.${o.name}}" var="${o.className?uncap_first}">
						<#list c.findClass(o.className,config).properties as p>
						<#if p.show == "true">
						<c:out value="${"$"}{${o.className?uncap_first}.${p.name}}" />&nbsp;
						</#if>
						</#list>
						<br />
					</c:forEach>
				</td>
			</tr>
		    </#list>
		</table>
		<br />
		<div class="center-opertion">
			<button onclick="javascript:history.back();" class="button">
				返回
			</button>
		</div>
	</body>
</html>
